package com.ruoyi.season.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.season.domain.PlaySeasonRecord;
import com.ruoyi.season.domain.vo.PlaySeasonInfoVo;
import com.ruoyi.season.mapper.PlaySeasonRecordMapper;
import com.ruoyi.season.service.IPlaySeasonRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 赛季记录Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-14
 */
@Service
public class PlaySeasonRecordServiceImpl extends ServiceImpl<PlaySeasonRecordMapper,PlaySeasonRecord> implements IPlaySeasonRecordService
{
    @Autowired
    private PlaySeasonRecordMapper playSeasonRecordMapper;

    /**
     * 查询赛季记录
     *
     * @param id 赛季记录主键
     * @return 赛季记录
     */
    @Override
    public PlaySeasonRecord selectPlaySeasonRecordById(String id)
    {
        return playSeasonRecordMapper.selectPlaySeasonRecordById(id);
    }

    /**
     * 查询赛季记录列表
     *
     * @param playSeasonRecord 赛季记录
     * @return 赛季记录
     */
    @Override
    public List<PlaySeasonRecord> selectPlaySeasonRecordList(PlaySeasonRecord playSeasonRecord)
    {
        return playSeasonRecordMapper.selectPlaySeasonRecordList(playSeasonRecord);
    }

    /**
     * 新增赛季记录
     *
     * @param playSeasonRecord 赛季记录
     * @return 结果
     */
    @Override
    public int insertPlaySeasonRecord(PlaySeasonRecord playSeasonRecord)
    {
        playSeasonRecord.setCreateTime(DateUtils.getNowDate());
        return playSeasonRecordMapper.insertPlaySeasonRecord(playSeasonRecord);
    }

    /**
     * 修改赛季记录
     *
     * @param playSeasonRecord 赛季记录
     * @return 结果
     */
    @Override
    public int updatePlaySeasonRecord(PlaySeasonRecord playSeasonRecord)
    {
        return playSeasonRecordMapper.updatePlaySeasonRecord(playSeasonRecord);
    }

    /**
     * 批量删除赛季记录
     *
     * @param ids 需要删除的赛季记录主键
     * @return 结果
     */
    @Override
    public int deletePlaySeasonRecordByIds(String[] ids)
    {
        return playSeasonRecordMapper.deletePlaySeasonRecordByIds(ids);
    }

    /**
     * 删除赛季记录信息
     *
     * @param id 赛季记录主键
     * @return 结果
     */
    @Override
    public int deletePlaySeasonRecordById(String id)
    {
        return playSeasonRecordMapper.deletePlaySeasonRecordById(id);
    }

    @Override
    public List<PlaySeasonInfoVo> selectAppuserSeasonByUserId(IPage<PlaySeasonInfoVo> page, String loginUserId) {
        return baseMapper.selectAppuserSeasonByUserId(page,loginUserId);
    }
}
